package io.practiceAll;

import java.io.*;

public class BufferedInputAndBOStream {
    public static void main(String[] args) throws IOException{
        FileInputStream fileInputStream = new FileInputStream("1.png");
        BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
        FileOutputStream fileOutputStream = new FileOutputStream("2.png");
        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(fileOutputStream);
        int a;
        while ((a=bufferedInputStream.read())!=-1){
            bufferedOutputStream.write(a);
        }
        bufferedInputStream.close();
        bufferedOutputStream.close();


    }
}
